package com.warm.mybatis.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.warm.mybatis.entity.BaseUserEntity;
import com.warm.mybatis.service.BaseUserService;
import com.warm.mybatis.service.impl.BaseUserServiceImpl;
import com.warm.mybatis.service.impl.TranscationServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Date: 2020/3/23 14:19
 * @Author: LChuang
 * @Description:
 */
@RestController
@RequestMapping(value = "/mybatis")
public class MybatisController {

    @Autowired
    private BaseUserService userService;

    @Autowired
    TranscationServiceImpl transcationService;

    @GetMapping("/test")
    public Object test(){
        List<BaseUserEntity> list = userService.list(new QueryWrapper<>());
        return list;
    }

    @GetMapping("/transaction")
    public Object transaction(){
        transcationService.test1();
        return null;
    }
}
